Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Prevent underflow in LastFinalizedBlockNumber calculation #484

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lukema95
Copy link

Description

In the collectFields function, when FirstBlockNumber is 0, calculating LastFinalizedBlockNumber = uint(FirstBlockNumber) - 1 would cause an integer underflow, resulting in a very large unsigned integer value.

Changes

Added validation for FirstBlockNumber to ensure it's not 0, preventing underflow when calculating LastFinalizedBlockNumber.

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • I have informed the team of any breaking changes if there are any.

Copy link

cla-assistant bot commented Jan 7, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

github-actions bot commented Feb 8, 2025

PR has had no activity for 30 days. What is blocking it? Is there anything you can do to help move it forward? Without action it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Feb 8, 2025
@github-actions github-actions bot removed the Stale label Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant